package org.fengdi.order.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

public class AccountServerRes {
    @Data
    @TableName("account")
    @Getter
    @Setter
    @NoArgsConstructor
    public static class DecreaseMoneyRes {
        @TableId(type = IdType.AUTO)
        public int id;

        @TableField("user_id")  // 明确指定数据库列名
        public String userId;

        @TableField("money")  // 明确指定数据库列名
        public double money;

        public DecreaseMoneyRes(String userId, double money) {
            this.userId = userId;
            this.money = money;
        }

        @Override
        public String toString() {
            return "Account{" +
                    "id=" + id +
                    ", userId='" + userId + '\'' +
                    ", money=" + money +
                    '}';
        }
    }
}
